package ar.com.gestion.componentes;

import java.util.LinkedList;
import java.util.List;

import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;

import ar.com.gestion.dominio.Venta;

public class CustomComboVentasModel  implements ComboBoxModel<Venta>{

	

	private List<Venta> listaVentas;
	private LinkedList<ListDataListener> listeners = new LinkedList<ListDataListener>();
	private Venta selectedItem = new Venta();
	
	
	
	
	@Override
	public int getSize() {
		return listaVentas.size();
	}

	@Override
	public Venta getElementAt(int index) {
		return listaVentas.get(index);
	}

	@Override
	public void addListDataListener(ListDataListener l) {
		
		listeners.add(l);
		
	}


	
	@Override
	public void removeListDataListener(ListDataListener l) {
		listeners.remove(l);
	}

	@Override
	public void setSelectedItem(Object anItem) {
		selectedItem =(Venta) anItem;
		
		
	}

	@Override
	public Venta getSelectedItem() {
		
		return selectedItem;
	}
	public void setListaVentas(List<Venta> listaVentas){
		
		this.listaVentas = listaVentas;
	}
	

	
}
